package com.ruoyi.system.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.ruoyi.system.domain.WcImgDetail;
import com.ruoyi.system.dto.WcImgPathEx;
import com.ruoyi.system.service.IWcImgDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WcImgPathMapper;
import com.ruoyi.system.domain.WcImgPath;
import com.ruoyi.system.service.IWcImgPathService;
import com.ruoyi.common.core.text.Convert;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-03-26
 */
@Service
public class WcImgPathServiceImpl implements IWcImgPathService 
{
    @Autowired
    private WcImgPathMapper wcImgPathMapper;

    @Autowired
    IWcImgDetailService wcImgDetailService;

    @Override
    public List<WcImgPathEx> genImageList(List<WcImgPath> list) {
        List<WcImgPathEx> list2 = new ArrayList<>();
        for (WcImgPath wcImgPath2: list
        ) {
            WcImgDetail wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(1l);
            WcImgPathEx wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("身份证");
            List<WcImgDetail> list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            List listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(2l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("驾驶证");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(3l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("银行卡");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(4l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("征信授权书");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(5l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("征信授权书签字照");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(6l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("手持征信授+身份证照");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(7l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("手持身份证照");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(8l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("投保单");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(9l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("投保单签字照");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(10l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("投保声明");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(11l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("挂靠协议(公户)");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(12l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("购车合同");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(13l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("推荐函");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(14l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("担保函");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(15l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("首付款凭证");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(16l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("客户告知书");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(17l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("代扣授权委托书");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(18l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("账户查询授权书");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(19l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("租赁合同");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(20l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("抵押合同");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(21l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("月供确认书");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(22l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("委托付款书");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);

            wcImgDetail = new WcImgDetail();
            wcImgDetail.setImgid(wcImgPath2.getId());
            wcImgDetail.setTypeid(23l);
            wcImgPathEx = new WcImgPathEx();
            wcImgPathEx.setTypeName("其它资料");
            list1 = wcImgDetailService.selectWcImgDetailList(wcImgDetail);
            listTmp = new ArrayList();
            for (WcImgDetail wcImgDetail1: list1
            ) {
                listTmp.add(wcImgDetail1.getPath());
            }
            wcImgPathEx.setImageList(listTmp);
            list2.add(wcImgPathEx);
        }

        return list2;
    }

    /**
     * 查询【请填写功能名称】
     * 
     * @param id 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */
    @Override
    public WcImgPath selectWcImgPathById(Long id)
    {
        return wcImgPathMapper.selectWcImgPathById(id);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param wcImgPath 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<WcImgPath> selectWcImgPathList(WcImgPath wcImgPath)
    {
        return wcImgPathMapper.selectWcImgPathList(wcImgPath);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param wcImgPath 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertWcImgPath(WcImgPath wcImgPath)
    {
        return wcImgPathMapper.insertWcImgPath(wcImgPath);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param wcImgPath 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateWcImgPath(WcImgPath wcImgPath)
    {
        return wcImgPathMapper.updateWcImgPath(wcImgPath);
    }

    /**
     * 删除【请填写功能名称】对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWcImgPathByIds(String ids)
    {
        return wcImgPathMapper.deleteWcImgPathByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param id 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteWcImgPathById(Long id)
    {
        return wcImgPathMapper.deleteWcImgPathById(id);
    }
}
